package com.chainyoung.component_tmperson.base;

import android.app.Application;
import android.content.Context;

import com.chainyoung.common.appcommon.db.DbDefaultConfiguration;
import com.chainyoung.common.appcommon.hdwallet.EtherscanService;
import com.chainyoung.common.base.CommonApplicationLike;
import com.chainyoung.common.constant.LibConstant;
import com.chainyoung.common.di.module.GlobeConfigModule;
import com.chainyoung.common.integration.ConfigModule;
import com.chainyoung.common.integration.IRepositoryManager;
import com.chainyoung.component_tmperson.R;
import com.chainyoung.component_tmperson.api.PersonService;
import com.chainyoung.component_tmperson.constant.PersonSystemConstant;

import java.util.List;

import io.realm.Realm;
import io.realm.RealmConfiguration;

public class PersonConfig implements ConfigModule {

    @Override
    public void applyOptions(Context context, GlobeConfigModule.Builder builder) {
        builder.baseurl(LibConstant.BASE_URL);
        //  .statusBarColor(R.color._3a5eff)
        // .statusBarAlpha(255);
//        if (BuildConfig.APP_DEBUG) {
//            //builder.addInterceptor(new HttpLoggingInterceptor().setLevel(Level.BODY));
//        }
    }

    @Override
    public void registerComponents(Context context, IRepositoryManager repositoryManager) {
        repositoryManager.injectRetrofitService(PersonService.class, EtherscanService.class);
        repositoryManager.injectRealmConfigs(DbDefaultConfiguration.getInstance());
    }

    @Override
    public void injectAppLifecycle(Context context, List<CommonApplicationLike.Lifecycle> lifecycles) {

    }

    @Override
    public void injectActivityLifecycle(Context context,
                                        List<Application.ActivityLifecycleCallbacks> lifecycles) {
    }

}
